<script setup lang="ts">
import { computed, inject,toRef } from 'vue';
const data: any = inject('data');
const info = computed(() => {
  return data.value.pc_pco_pca_list||[]
})
const count = computed(() => {
  if(info.value.length === 0) return {};
  return info.value.reduce((prev, cur) => {
    return {
      PC02AS03: +prev.PC02AS03 + +cur.PC02AS03
    }
  })
})
</script>
<template>
  <div class="h3 title">（1）信贷交易信息提示</div>
  <table>
  <tbody>
    <tr>
      <th colspan="2">业务类型</th>
      <th>账户数</th>
      <th>首笔业务发放月份</th>
    </tr>
    <tr v-for="(item, i) in info" :key="i">
      <td>{{ item.PC02AD02 }}</td>
      <td>{{ item.PC02AD01 }}</td>
      <td>{{ item.PC02AS03 }}</td>
      <td>{{ item.PC02AR01 }}</td>
    </tr>
    <tr>
      <th colspan="2">合计</th>
      <td>{{ count.PC02AS03 }}</td>
      <td></td>
    </tr>
    
    
  </tbody>
</table>
</template>